package com.amydomi.utils;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class Response <T> {
    private T data;
    private String message;
    private int status;

    public static <S> Response<S> success(S data) {
        return new Response<>(data, "Success", 200);
    }

    public static <S> Response<S> error(String message, int status) {
        return new Response<>(null, message, status);
    }

    public static <S> Response<S> error(String message) {
        return error(message, 400);
    }
}
